package cn.iocoder.yudao.module.asasc.controller.admin.campaign.vo;

import cn.iocoder.yudao.framework.common.pojo.PageParam;
import io.swagger.v3.oas.annotations.media.Schema;
import lombok.Data;
import lombok.EqualsAndHashCode;
import lombok.ToString;
import org.springframework.format.annotation.DateTimeFormat;

import java.time.LocalDate;
import java.time.LocalDateTime;
import java.util.Arrays;
import java.util.List;

import static cn.iocoder.yudao.framework.common.util.date.DateUtils.FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND;

@Schema(description = "管理后台 - 广告数据分页 Request VO")
@Data
@EqualsAndHashCode(callSuper = true)
@ToString(callSuper = true)
public class CampaignDataPageReqVO extends PageParam {

    @Schema(description = "日期")
    @DateTimeFormat(pattern = FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND)
    private LocalDate[] date;

    @Schema(description = "国家或地区代码")
    private String countryOrRegion;

    @Schema(description = "广告系列 ID", example = "24587")
    private Long campaignId;

    @Schema(description = "广告系列名称", example = "张三")
    private String campaignName;

    @Schema(description = "是否删除")
    private Boolean isDeleted;

    @Schema(description = "广告系统状态", example = "2")
    private String campaignStatus;

    @Schema(description = "应用名称", example = "张三")
    private String appName;

    @Schema(description = "应用 ID", example = "25557")
    private Long adamId;

    @Schema(description = "状态", example = "2")
    private String servingStatus;

    @Schema(description = "国家或地区")
    private String countriesOrRegions;

    @Schema(description = "展示状态", example = "1")
    private String displayStatus;

    @Schema(description = "广告展示位置")
    private String supplySources;

    @Schema(description = "广告渠道类型", example = "2")
    private String adChannelType;

    @Schema(description = "组织 ID", example = "26593")
    private Long orgId;

    @Schema(description = "创建时间")
    @DateTimeFormat(pattern = FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND)
    private LocalDateTime[] createTime;

    @Schema(description = "应用Ids", example = "25557,12213")
    private Long[] adamIds;
    @Schema(description = "国家代码集合", example = "CN,US")
    private String[] countries;
    @Schema(description = "维度：日期、国家、应用、广告系列")
    private String[] dimension;

    /*private boolean containsDate;
    private boolean containsCountry;
    private boolean containsAdamId;
    private boolean containsCampaignId;

    public void setDimension(String[] dimension) {
        this.dimension = dimension;
        List<String> dimensionList = Arrays.asList(dimension);
        this.containsDate = dimensionList.contains("date");
        this.containsCountry = dimensionList.contains("country");
        this.containsAdamId = dimensionList.contains("adamId");
        this.containsCampaignId = dimensionList.contains("campaignId");
    }*/
}